#!/bin/bash
#tomcat版本可根据自己安装

tomcat8_version=apache-tomcat-8.0.47
tomcat8_native_version=tomcat-native-1.2.14-src
#tomcat8 apr
yum install apr-devel
yum install openssl-devel
yum install gcc
yum install make

tar -zvxf ${tomcat8_version}.tar.gz && cd ${tomcat_version}/bin
tar -zxvf tomcat-native.tar.gz && cd ${tomcat8_native_version}/native
./configure && make && make install

#定义apr路径
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
#export LD_RUN_PATH=$LD_RUN_PATH:/usr/local/apr/lib
cp /usr/local/apr/lib/libtcnative* /usr/lib/

sed -i '69s/HTTP\/1.1/org.apache.coyote.http11.Http11AprProtocol/g' /opt/${tomcat8_version}/conf/server.xml
